package edu.sctu.wulixia.month4and5.day20150524;

/**
 * Created by user05 on 2015/5/24.
 */
/*
 创建一个类为TextOne,TextOne继承自TextMore，
  TextOne 里面有三个方法 getTercherInfo() 对老师学号排序后输出老师信息，
   getStudent(int code) 处理学生成绩排序后的成绩大于coed的学生。
   getCode()判断职称为教授的学生有哪些，
  并调用接口判断学生成绩大于code的学生， 判断调用getStudent(int code)方法。
 */
public class TestOne extends TestMore{
    public void getTeacherInfo(){
        Teacher[] teacherarry2 = sotrNumber();

        for(int i = 0;i<teacherarry2.length;i++){
            System.out.println(teacherarry2[i].getNumber()+"  "+teacherarry2[i].getName()+
                    " "+teacherarry2[i].getSex()+" "+teacherarry2[i].getPosition()+" "+teacherarry2[i].getLesson());
            System.out.println("学生有:");

            for(int j = 0; j<teacherarry2[i].getStudent().length;j++){
                System.out.println(teacherarry2[i].getStudent()[j].getName());
            }
        }
    }

    //getStudents(int code)处理学生成绩排序后的成绩大于coed的学生。

    public void getStudents(int code){

        Teacher_Info teacher_info = new Teacher_Info();
        Teacher[] teachers = teacher_info.isTeachersMassage();

        Student[] students0 = teachers[0].getStudent();
        Student[] students1 = teachers[1].getStudent();
        Student[] students2 = teachers[2].getStudent();

        sortStudent(students0);
        sortStudent(students1);
        sortStudent(students2);

        for (int i = 0;i < students0.length;i ++){
            System.out.println("学生成绩大于coed("+code+")的有：");
            if (students0[i].getScore() > code){
                System.out.println(students0[i].getName());
            }
        }

        for (int i = 0;i < students1.length;i ++){
            System.out.println("学生成绩大于coed("+code+")的有：");
            if (students1[i].getScore() > code){
                System.out.println(students1[i].getName());
            }
        }
        for (int i = 0;i < students2.length;i ++){
            System.out.println("学生成绩大于coed("+code+")的有：" );
            if (students2[i].getScore() > code){
                System.out.println(students2[i].getName());
            }
        }
    }
    //  getCode()判断职称为教授的学生有哪些,并调用接口判断学生成绩大于code的学生， 判断调用getStudent(int code)方法。

    public void getCode(){
//        Teacher_Info teacher_info = new Teacher_Info();
//        Teacher[] teacher_students = teacher_info.isTeachersMassage();
//
//        Student[] students0 = teacher_students[0].getStudent();
//        Student[] students1 = teacher_students[1].getStudent();
//        Student[] students2 = teacher_students[2].getStudent();
//
//        printCode(students0);
//        printCode(students1);
//        printCode(students2);
    }
}
